{% set uniqid = uniqid ?? uniqid('permission_') %}
{% set idBase = "rabbitmq-users-#{userId}-permissions-#{uniqid}" %}
{% set nameBase = "rabbitmq[users][#{userId}][permissions][#{uniqid}]" %}

<div id="{{ idBase }}" data-uniqid="{{ uniqid }}" data-name="{{ nameBase }}"
     class="tab-pane {{ active is defined and active ? 'active' }}">
    <div class="form-group col-xs-12 col-sm-6">
        <label for="{{ idBase }}-host">
            Virtual Host Name
        </label>
        <input type="text" id="{{ idBase }}-host"
               name="{{ nameBase }}[host]"
               placeholder="myhost" class="form-control"
               value="{{ permission.host }}" />
        <div class="help-block">
            Virtual host must be added in the section above!
        </div>
    </div>

    <div class="form-group col-xs-12 col-sm-6">
        <label for="{{ idBase }}-configure_permission">
            Configure Permission
        </label>
        <input type="text" id="{{ idBase }}-configure_permission"
               name="{{ nameBase }}[configure_permission]"
               placeholder=".*" class="form-control"
               value="{{ permission.configure_permission }}" />
    </div>

    <div class="clearfix"></div>

    <div class="form-group col-xs-12 col-sm-6">
        <label for="{{ idBase }}-read_permission">
            Read Permission
        </label>
        <input type="text" id="{{ idBase }}-read_permission"
               name="{{ nameBase }}[read_permission]"
               placeholder=".*" class="form-control"
               value="{{ permission.read_permission }}" />
    </div>

    <div class="form-group col-xs-12 col-sm-6">
        <label for="{{ idBase }}-write_permission">
            Write Permission
        </label>
        <input type="text" id="{{ idBase }}-write_permission"
               name="{{ nameBase }}[write_permission]"
               placeholder=".*" class="form-control"
               value="{{ permission.write_permission }}" />
    </div>

    <div class="clearfix"></div>
</div>
